const {app,pool,Result} = require('./connect');

const login = require('./Routes/login');
const userinfo = require('./Routes/userinfo');
const usersinfo = require('./Routes/usersinfo');
const todolist = require('./Routes/todolist');

app.all('*',(req,res,next)=>{
	// 处理全局拦截
	console.log('req.params')
	next();
})

app.get('/',(req,res)=>{
	pool.getConnection((err,conn)=>{
		res.send("<a href='./login'>登录</a>")
		conn.release();
	})
})

app.use('/login',login);
app.use('/userinfo',userinfo);
app.use('/usersinfo',usersinfo);
app.use('/todolist',todolist);

/* 监听端口 */
app.listen(3000, () => {
    console.log('——————————服务已启动——————————');
})
